package wzc.design_pattern.behaviour.mediator;

/**
 * @Author 那和不是个啥
 * @Date 2025/7/20
 * @Description
 */

public class MediatorPatternDemo {
    public static void main(String[] args) {
        ChatRoom chatRoom = new ChatRoom();

        UserA userA = new UserA(chatRoom);
        UserB userB = new UserB(chatRoom);
        chatRoom.addColleague(userA);
        chatRoom.addColleague(userB);

        userA.send("你好，其它用户");
        userB.send("你也好呀");
    }
}
